
public class TestDate {
	public static void main(String[] args) {
		// check the following at http://www.timeanddate.com/date/durationresult.html
		
		try
		{
			new DateCalculator("15/3/2004", "31/3/2004");
			new DateCalculator("15/3/2004", "16/4/2005");	// March 15th, 2004 to April 16th, 2005: 398 Days (Include End and Start Date in calculation)
			new DateCalculator("15/3/2004", "18/3/2004");	
			new DateCalculator("15/3/2004", "18/4/2004");	// March 15th, 2004 to April 18th, 2004: 35 Days (Include End and Start Date in calculation)
			new DateCalculator("15/3/2004", "18/6/2004");
			new DateCalculator("15/2/2004", "18/3/2004");
			new DateCalculator("15/2/2005", "18/3/2005");
			new DateCalculator("15/2/1999", "18/3/2005");
			new DateCalculator("1/1/1800", "1/1/2100");
		} 
		catch (InvalidDateString e) {
			e.printStackTrace();
		} catch (CalculationError e) {
			e.printStackTrace();
		}
		
		// errors
		try {
			new DateCalculator("32/1/1800", "1/1/2100");
		} catch (InvalidDateString e) {
			e.printStackTrace();
		} catch (CalculationError e) {
			e.printStackTrace();
		}
		
		try {
			new DateCalculator("30/2/1800", "1/1/2100");
		} catch (InvalidDateString e) {
			e.printStackTrace();
		} catch (CalculationError e) {
			e.printStackTrace();
		}
		
		try {
			new DateCalculator("29/2/2003", "1/1/2100");
		} catch (InvalidDateString e) {
			e.printStackTrace();
		} catch (CalculationError e) {
			e.printStackTrace();
		}
		
		try {
			new DateCalculator("29/2/2004", "0/1/2100");
		} catch (InvalidDateString e) {
			e.printStackTrace();
		} catch (CalculationError e) {
			e.printStackTrace();
		}
		
		try {
			new DateCalculator("29/2/2004", "5/0/1999");
		} catch (InvalidDateString e) {
			e.printStackTrace();
		} catch (CalculationError e) {
			e.printStackTrace();
		}
		
		try {
			new DateCalculator("29/2/2004", "5/13/1999");
		} catch (InvalidDateString e) {
			e.printStackTrace();
		} catch (CalculationError e) {
			e.printStackTrace();
		}
		
		try {
			new DateCalculator("29/2/2004", "2/1/2100");
		} catch (InvalidDateString e) {
			e.printStackTrace();
		} catch (CalculationError e) {
			e.printStackTrace();
		}
		
		try {
			new DateCalculator("31/12/1799", "1/1/2100");
		} catch (InvalidDateString e) {
			e.printStackTrace();
		} catch (CalculationError e) {
			e.printStackTrace();
		}
		
		try {
			new DateCalculator("1/1/1799", "1/1/2100");
		} catch (InvalidDateString e) {
			e.printStackTrace();
		} catch (CalculationError e) {
			e.printStackTrace();
		}
	
	}
}
